import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/wb";

// 查询考试领域列表
export function listExamslevel(data) {
  return request({
    url: '/examslevel/list',
    method: 'post',
    data
  })
}

// 考试领域详细
export function getExamslevel(id) {
  return request({
    url: '/examslevel/' + parseStrEmpty(id),
    method: 'get'
  })
}

// 新增考试领域
export function addExamslevel(data) {
  return request({
    url: '/examslevel/add',
    method: 'post',
    data
  })
}

// 修改考试领域
export function updateExamslevel(data) {
  return request({
    url: '/examslevel/update',
    method: 'post',
    data
  })
}

// 删除考试领域（支持批量）
export function delExamslevel(idOrIds) {
  const ids = Array.isArray(idOrIds) ? idOrIds : [idOrIds]
  return request({
    url: '/examslevel/deleteAll',
    method: 'delete',
    data: { ids }
  })
}

